package com.elysia.visionmanagerspringboot.controller;

import com.elysia.visionmanagerspringboot.domain.dto.UserDTO;
import com.elysia.visionmanagerspringboot.result.Result;
import com.elysia.visionmanagerspringboot.service.impl.IUserServiceImpl;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/universal")
@RequiredArgsConstructor
@Slf4j
public class UniversalController {
    private final IUserServiceImpl userService;
    @PostMapping("/login")
    public Result<Object> login(@RequestBody UserDTO userDTO, HttpServletResponse response){
        log.info("用户登录");
        return userService.login(userDTO, response);
    }
}
